package com.kingscup;

import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.state.StateBasedGame;

import com.kingscup.gamestates.*;
import com.kingscup.Storage;

public class KingsCup extends StateBasedGame {
	
	int MAINMENU = Storage.MAINMENU;
	int INGAME = Storage.INGAME;
	int HELPMENU = Storage.HELPMENU;
	int PLAYERMENU = Storage.PLAYERMENU;
	int PLAYERNAMEMENU = Storage.PLAYERNAMEMENU;
	
	public String play;
	public Color color;
	public static GameContainer gameContainer;

	public KingsCup() throws SlickException {
		super("King's Cup");

		gameContainer = this.getContainer();

		this.addState(new MainMenu(MAINMENU));
		this.addState(new InGame(INGAME));
		this.addState(new HelpMenu(HELPMENU));
		this.addState(new PlayerMenu(PLAYERMENU));
		this.addState(new PlayerNameMenu(PLAYERNAMEMENU));

		this.enterState(PLAYERMENU);
	}

	public static void main(String[] args) {
		try {
			AppGameContainer app = new AppGameContainer(new KingsCup());
			app.setDisplayMode(800, 600, false);
			app.start();
		} catch (SlickException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void initStatesList(GameContainer gameContainer)
			throws SlickException {
		this.getState(MAINMENU).init(gameContainer, this);
		this.getState(HELPMENU).init(gameContainer, this);
		this.getState(PLAYERMENU).init(gameContainer, this);
		this.getState(INGAME).init(gameContainer, this);
		this.getState(PLAYERNAMEMENU).init(gameContainer, this);
	}
}
